314 - Robot (BFS)
[and.git] / 10079 - Pizza Cutting / 10079.cpp
blob1ecdc953f82563a80e2a4267538d097db2f00760
1 #include <cstdlib>
2 #include <iostream>
4 using namespace std;
6 int main(int argc, char *argv[])
8 long long n, max;
9 cin >> n;
10 while (n >= 0){
11 if (n % 2 == 0){
12 max = n / 2;
13 max *= (n + 1);
14 max++;
15 }else{
16 max = (n + 1) / 2;
17 max *= n;
18 max++;
20 cout << max << endl;
21 cin >> n;
23 return 0;